#ifndef _U_DISPBOOK_WIDGET_H_
#define _U_DISPBOOK_WIDGET_H_

#include "uclientserver.h"
#include <QWidget>
#include <QList>
class QScrollArea;
class UScrollBar;
class UBooksInfo
{
	friend class UDispBookInfoBox;
public:

	QString m_title; //书名，作者，出版社，ISBN，出版日期，图片
	QString m_author;
	QString m_press;
	QString m_isbn;
	QString m_date;
	QString m_image;

	friend QDataStream& operator<<(QDataStream& out, const UBooksInfo& books);
	friend QDataStream& operator>>(QDataStream& in, UBooksInfo& books);

};

class UDispBookInfoBox;
class UDispBookWidget  : public QWidget
{
	Q_OBJECT

public:
	UDispBookWidget(QWidget *parent);
	~UDispBookWidget();
	void clearWidget();

	QList<UDispBookInfoBox* > m_pBoxList;
	QList<UBooksInfo> m_pBooksInfoList;
private slots:
	void readBooksInfoList(const OPERATOR type, QByteArray datagram);
	void onScrollBarValueChanged(int value);

private:
	void addContactBox(UBooksInfo book);

	UScrollBar* m_pScrollBar;
};

#endif
